import random
import math
import signal
# import time

class TSP:
    def __init__(self):
        self.__datas = []
        self.__dises = []
        self.__cont = True
        signal.signal(signal.SIGINT, self.on_exit)
        signal.signal(signal.SIGTERM, self.on_exit)

    def on_exit(self):
        self.__cont = False

    def read(self):
        try:
            while True:
                n = input()
                i,x,y = n.split()
                self.__datas.append((int(i),float(x),float(y)))
        except EOFError:
            pass
        '''
        st = time.time()
        for i in range(2500):
            x = random.random() * 2e5 - 1e5
            y = random.random() * 2e5 - 1e5
            self.__datas.append((i+1, x, y))
        '''
        self.__dises = [0] * (len(self.__datas)**2)
        for i,v in enumerate(self.__datas):
            for j,vv in enumerate(self.__datas):
                if i == j:
                    continue
                x0,y0 = v[1:]
                x1,y1 = vv[1:]
                self.__dises[i * len(self.__datas) + j] = math.sqrt((x0-x1)**2+(y0-y1)**2)
        # print(f'read time: {time.time() - st:.1f}s')

    def dis(self, ids):
        return sum((self.__dises[v * len(self.__datas) + ids[i-1]] for i,v in enumerate(ids)))

    def run(self):
        k = 0.99
        p = 10000

        # st = time.time()

        s = list(range(len(self.__datas)))
        e = self.dis(s)
        e_min, s_min = e, s
        t = 1
        i = 0
        while t > 0 and i < p and self.__cont: 
            n1,n2=sorted(random.sample(range(len(s)), 2))
            sn = s[:n1] + list(reversed(s[n1:n2])) + s[n2:]
            en = self.dis(sn)
            if en < e:
                e,s = en,sn
            elif random.random() < math.exp((e - en) / t):
                e,s = en,sn
            if e < e_min:
                i = 0
                e_min,s_min = e,s
            else:
                i += 1
            t *= k
        # print(f'{k:<10}{p:<5}{e_min:.2f}  {time.time() - st:.1f}s')
        for x in s_min:
            print(self.__datas[x][0])

if __name__ == '__main__':
    tsp = TSP()
    tsp.read()
    tsp.run()
